//  这是vote的reducer

import * as TYPES from '../action-types'

const initVal = {
    supNum: 10,
    oppNum: 5,
    num: 0
}

export default function voteReducer(state = initVal, action) {
    // 克隆一份
    state = { ...state }

    switch (action.type) {
        case TYPES.VOTE_SUP:
            state.supNum++
            break;
        case TYPES.VOTE_OPP:
            state.oppNum++
            break;
        default:

    }

    return state
}
